﻿using Basic.HrRemoteModel.AppPower;
using Basic.HrRemoteModel.Power.Model;
using Basic.HrService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.HrService.RpcEvent
{
    internal class AppPowerEvent : IRpcApiService
    {
        private readonly IAppPowerService _Service;

        public AppPowerEvent ( IAppPowerService service )
        {
            this._Service = service;
        }

        public void DeleteAppPower ( DeleteAppPower obj )
        {
            this._Service.Delete(obj.LinkType, obj.LinkPk);
        }

        public PowerData FindAppPower ( FindAppPower obj )
        {
            return this._Service.Get(obj.LinkType, obj.LinkPk);
        }

        public bool SaveAppPower ( SaveAppPower obj )
        {
            return this._Service.Save(obj.LinkType, obj.LinkPk, obj.Power);
        }

        public bool SetAppPowerIsEnable ( SetAppPowerIsEnable obj )
        {
            return this._Service.SetIsEnable(obj.LinkType, obj.LinkPk, obj.IsEnable);
        }
    }
}
